package com.example.adminframework.common.exception;


import com.example.adminframework.constant.HttpCode;

import java.util.List;
import java.util.Map;

/**
 * 类描述：单独验证异常
 */
public class ValidationException extends RuntimeException {
    /**
     * httpCode
     */
    private HttpCode httpCode;
    /**
     * 验证错误具体数据
     */
    private Map<String, List<Map<String, String>>> data;

    public ValidationException(HttpCode httpCode, Map<String, List<Map<String, String>>> data) {
        this.httpCode = httpCode;
        this.data = data;
    }

    public HttpCode getHttpCode() {
        return httpCode;
    }

    public void setHttpCode(HttpCode httpCode) {
        this.httpCode = httpCode;
    }

    public Map<String, List<Map<String, String>>> getData() {
        return data;
    }

    public void setData(Map<String, List<Map<String, String>>> data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ValidationException{" +
                "httpCode=" + httpCode +
                ", data=" + data +
                '}';
    }
}
